package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the ttest database table.
 * 
 */
@Entity
@NamedQuery(name="Ttest.findAll", query="SELECT t FROM Ttest t")
public class Ttest implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int ttestid;

	private int ttestavrage;

	@Temporal(TemporalType.TIMESTAMP)
	private Date ttestdate;

	private String ttestledge;

	private String ttestname;

	private String ttesttheme;

	private int ttesttnums;

	//bi-directional many-to-one association to Course
	@OneToMany(mappedBy="ttest")
	private List<Course> courses;

	//bi-directional many-to-one association to Record
	@OneToMany(mappedBy="ttest")
	private List<Record> records;

	//bi-directional many-to-one association to Tarrange
	@OneToMany(mappedBy="ttest")
	private List<Tarrange> tarranges;

	//bi-directional many-to-many association to Titem
	@ManyToMany(mappedBy="ttests")
	private List<Titem> titems;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staff_id")
	private Staff staff;

	//bi-directional many-to-many association to Texam
	@ManyToMany
	@JoinTable(
		name="kaojuan_shijuan"
		, joinColumns={
			@JoinColumn(name="ttestid")
			}
		, inverseJoinColumns={
			@JoinColumn(name="texamid")
			}
		)
	private List<Texam> texams;

	//bi-directional many-to-one association to Tmark
	@ManyToOne
	@JoinColumn(name="tmarkid")
	private Tmark tmark;

	public Ttest() {
	}

	public int getTtestid() {
		return this.ttestid;
	}

	public void setTtestid(int ttestid) {
		this.ttestid = ttestid;
	}

	public int getTtestavrage() {
		return this.ttestavrage;
	}

	public void setTtestavrage(int ttestavrage) {
		this.ttestavrage = ttestavrage;
	}

	public Date getTtestdate() {
		return this.ttestdate;
	}

	public void setTtestdate(Date ttestdate) {
		this.ttestdate = ttestdate;
	}

	public String getTtestledge() {
		return this.ttestledge;
	}

	public void setTtestledge(String ttestledge) {
		this.ttestledge = ttestledge;
	}

	public String getTtestname() {
		return this.ttestname;
	}

	public void setTtestname(String ttestname) {
		this.ttestname = ttestname;
	}

	public String getTtesttheme() {
		return this.ttesttheme;
	}

	public void setTtesttheme(String ttesttheme) {
		this.ttesttheme = ttesttheme;
	}

	public int getTtesttnums() {
		return this.ttesttnums;
	}

	public void setTtesttnums(int ttesttnums) {
		this.ttesttnums = ttesttnums;
	}

	public List<Course> getCourses() {
		return this.courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}

	public Course addCours(Course cours) {
		getCourses().add(cours);
		cours.setTtest(this);

		return cours;
	}

	public Course removeCours(Course cours) {
		getCourses().remove(cours);
		cours.setTtest(null);

		return cours;
	}

	public List<Record> getRecords() {
		return this.records;
	}

	public void setRecords(List<Record> records) {
		this.records = records;
	}

	public Record addRecord(Record record) {
		getRecords().add(record);
		record.setTtest(this);

		return record;
	}

	public Record removeRecord(Record record) {
		getRecords().remove(record);
		record.setTtest(null);

		return record;
	}

	public List<Tarrange> getTarranges() {
		return this.tarranges;
	}

	public void setTarranges(List<Tarrange> tarranges) {
		this.tarranges = tarranges;
	}

	public Tarrange addTarrange(Tarrange tarrange) {
		getTarranges().add(tarrange);
		tarrange.setTtest(this);

		return tarrange;
	}

	public Tarrange removeTarrange(Tarrange tarrange) {
		getTarranges().remove(tarrange);
		tarrange.setTtest(null);

		return tarrange;
	}

	public List<Titem> getTitems() {
		return this.titems;
	}

	public void setTitems(List<Titem> titems) {
		this.titems = titems;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<Texam> getTexams() {
		return this.texams;
	}

	public void setTexams(List<Texam> texams) {
		this.texams = texams;
	}

	public Tmark getTmark() {
		return this.tmark;
	}

	public void setTmark(Tmark tmark) {
		this.tmark = tmark;
	}

}